package by.plisitsa.railway.datamodel;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ManyToOne;

@Entity
public class Train extends AbstractEntity {
	@Column
	private String nameTrn;
	
	@ManyToOne(fetch = FetchType.LAZY, targetEntity = Wagon.class)
	private Wagon wagon;
	
	@ManyToOne(fetch = FetchType.LAZY, targetEntity = TrainType.class)
	private TrainType trainType;

	public String getNameTrn() {
		return nameTrn;
	}

	public void setNameTrn(String nameTrn) {
		this.nameTrn = nameTrn;
	}

	public Wagon getWagon() {
		return wagon;
	}

	public void setWagon(Wagon wagon) {
		this.wagon = wagon;
	}

	public TrainType getTrainType() {
		return trainType;
	}

	public void setTrainType(TrainType trainType) {
		this.trainType = trainType;
	}

}
